/*
 * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *    Eike Stepper - initial API and implementation
 */
package org.eclipse.emf.extensions;

import java.sql.Connection;
import java.sql.SQLException;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EStructuralFeature;

/**
 * Specifies a number of {@link IDBTable DB tables} that can be created in or dropped from a database through a
 * {@link IDBAdapter DB adapter}.
 * 
 * @author Eike Stepper
 */
public interface IDBSchema {
    public void dropTable(IDBTable table) throws SQLException;

    public IDBTable findTable(IDBTableDescriptor descriptor) throws SQLException;

    public IDBTable[] getTables() throws SQLException;

    public IDBTable createTable(IDBTableDescriptor descriptor) throws SQLException;

    public void createOrUpdateDBStructure() throws SQLException;

    public abstract Connection getConnection();

    public abstract EPackage getPackage();

    public boolean requireIndexLength();

    public boolean checkModificationTime();

    public String getColumnName(EStructuralFeature feature);

    public String getTableName(EClass clazz);

    public String getDBVersion();

    public String getName();

}
